<template>
  <highlightjs autodetect :code="code"></highlightjs>
</template>

<script>
import 'highlight.js/styles/stackoverflow-light.css' // 可以切换其它样式风格，例如黑色主题
import 'highlight.js/lib/common'
import hljsVuePlugin from '@highlightjs/vue-plugin'
export default {
  name: 'DuPre',
  components: {
    highlightjs: hljsVuePlugin.component,
  },
  props: {
    code: {
      type: String,
      default: '',
    },
  },
}
</script>

<style scoped></style>
